package com.ylyq.ylxx.controller;

import com.ylyq.ylxx.model.ResponseData;
import com.ylyq.ylxx.model.bean.*;
import com.ylyq.ylxx.model.request.*;
import com.ylyq.ylxx.service.IOceanengineSiteService;
import com.ylyq.ylxx.service.IOceanengineToolService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName OceanengineSiteController
 * @Description TODO
 * @Author xiaweichao
 * @Date 2020/7/27 18:16
 * @Version 1.0
 */
@RestController
@RequestMapping("/oCeanengine/site")
@Api(description = "巨量引擎的落地页相关接口")
public class OceanengineSiteController {
    @Autowired
    private IOceanengineSiteService iOceanengineToolService;

    @PostMapping("/getLanding")
    @ApiOperation(value = "获取程序化落地页",response = OceanengineGetLandingPackage.class)
    public ResponseData getLanding(@RequestBody GetLandingRequest getLandingRequest){
        return iOceanengineToolService.getLanding(getLandingRequest);
    }

    @PostMapping("/getTetrisSite")
    @ApiOperation(value = "获取橙子建站站点列表",response = OceanengineGetTetrisSite.class)
    public ResponseData getTetrisSite(@RequestBody TetrisSiteRequest getLandingRequest){
        return iOceanengineToolService.getTetrisSite(getLandingRequest);
    }

    @PostMapping("/getThirdSite")
    @ApiOperation(value = "获取第三方落地页站点列表",response = OceanengineGetThirdSite.class)
    public ResponseData getThirdSite(@RequestBody ThirdSiteRequest thirdSiteRequest){
        return iOceanengineToolService.getThirdSite(thirdSiteRequest);
    }

    @PostMapping("/getAdConvert")
    @ApiOperation(value = "查询计划可用转化ID",response = OceanengineGetAdConvert.class)
    public ResponseData getAdConvert(@RequestBody GetAdConvertRequest getAdConvertRequest){
        return new ResponseData(ResponseData.Result.SUCCESS,iOceanengineToolService.getAdConvert(getAdConvertRequest));
    }

    @PostMapping("/queryAdConvert")
    @ApiOperation(value = "查询计划可用转化ID",response = OceanengineQueryAdConvert.class)
    public ResponseData queryAdConvert(@RequestBody QueryAdConvertRequest getAdConvertRequest){
        return new ResponseData(ResponseData.Result.SUCCESS,iOceanengineToolService.queryAdConvert(getAdConvertRequest));
    }
}
